﻿using System;
using InterfaceLiftLib.Models.Enums;
using InterfaceLiftLib.Service.Interfaces;

namespace InterfaceLiftLib.Converters.Enums
{
    class SortOrderConverter : IQueryStringEnumToStringConverter
    {
        public string GetStringValue(object enumValue)
        {
            var val = (SortOrder) enumValue;
            switch (val)
            {
                case SortOrder.Ascending:
                    return "asc";
                case SortOrder.Descending:
                    return "desc";
                default:
                    throw new ArgumentOutOfRangeException("enumValue");
            }
        }
    }
}
